<template>
  <div class="layui-tab-content">

    <table class="user-table">
      <thead>
      <tr>
        <th>班号</th>
        <th>课程</th>
        <th>开始时间</th>
        <th>结束时间</th>
        <th>人数</th>
      </tr>
      </thead>
      <tbody v-for="c in classes" :key="c.classId">
      <tr>

        <td v-text="c.classId">1</td>
        <td v-text="c.courseName">小明</td>
        <td v-text="c.startTime">123456</td>
        <td v-text="c.endTime">123456</td>
        <td v-text="c.numbers">123456</td>
        <td class="admin-manage">
          <a  href="javascript:void(0)" @click="toClassDetail(c.classId)">
            查看详情
          </a>
        </td>



      </tr>

      </tbody>
    </table>


  </div>
</template>

<script>
export default {
  name: "ClassList",
  data() {
    return {
      classes :null
    }

  },
  created() {
    this.initClass();
  },
  methods:{
    initClass() {
      const that = this;
      that.axios.get("/api/class_list").then(({ data }) => {
        this.classes = data.data;
      });
    },
    toClassDetail(id) {
      this.$router.push({ path: "/ClassDetail/"+id });
    }
  }

}
</script>

<style scoped>

</style>
